/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #F5F5F7;
    color: #1C1C1E;
    min-height: 100vh;
    /* 禁止弹性滚动效果 */
    overscroll-behavior: none;
    /* 禁止页面左右滑动滚动 */
    overflow-x: hidden;
    /* 禁止iOS上的弹性滚动 */
    -webkit-overflow-scrolling: touch;
}

/* 同时禁止html元素的弹性滚动并隐藏滚动条 */
html {
    overscroll-behavior: none;
    overflow-x: hidden;
    /* 隐藏滚动条但保持功能 */
    -ms-overflow-style: none;  /* IE 和 Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Webkit浏览器特定样式 - 隐藏垂直滚动条
   注：::-webkit-scrollbar是Webkit浏览器(Chrome、Safari等)的专有伪元素，用于自定义滚动条
   虽然不是标准CSS选择器，但在现代Web设计中被广泛用于实现特定UI效果 */
html::-webkit-scrollbar {
    display: none;
}

html::-webkit-scrollbar-track {
    display: none;
}

html::-webkit-scrollbar-thumb {
    display: none;
}

body::-webkit-scrollbar {
    display: none;
}

body::-webkit-scrollbar-track {
    display: none;
}

body::-webkit-scrollbar-thumb {
    display: none;
}

/* 渐变色背景 - 移动设备友好的方式 */
.page {
    background: linear-gradient(150deg, #FDCFE8 0%, #E4C1F9 50%, #BDE0FE 100%);
    min-height: 100vh;
    padding-bottom: 20px;
}

/* 内容容器 */
.content-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Tab导航 */
.tab-bar {
    background: transparent;
    padding: 10px 20px;
    overflow-x: auto;
    white-space: nowrap;
    /* 隐藏滚动条但保持功能 */
    -ms-overflow-style: none;  /* IE 和 Edge */
    scrollbar-width: none;  /* Firefox */
    padding-top: 40px;
}

/* Webkit浏览器特定样式 - 隐藏Tab栏滚动条 */
.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab-bar::-webkit-scrollbar-track {
    display: none;
}

.tab-bar::-webkit-scrollbar-thumb {
    display: none;
}

.tab-container {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    max-width: 700px;
    margin: 0 auto;
}

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 12px;
    text-align: center;
    cursor: pointer;
    position: relative;
    font-size: 16px;
    font-weight: 500;
    color: #8E8E93;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #F5F5F5;
    transform: translateY(1px);
    border: none; /* 删除边框 */
}

.tab.active {
    background: linear-gradient(90deg, rgba(127, 83, 221, 0.2), rgba(192, 104, 193, 0.6), rgba(234, 115, 176, 1.0));
    color: white;
}

/* 主内容区 */
main {
    padding: 20px;
}

/* Tab内容区域 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.card h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1C1C1E;
}

.card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* 统计卡片 */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.stat-card .title {
    font-size: 14px;
    color: #8E8E93;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.stat-card .value {
    font-size: 24px;
    font-weight: 700;
}

.stat-card .trend {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
}

.trend.up {
    background-color: rgba(52, 199, 89, 0.1);
    color: #34C759;
}

.trend.stable {
    background-color: rgba(90, 200, 250, 0.1);
    color: #5AC8FA;
}

/* 进度条 */
.progress-container {
    margin-bottom: 16px;
}

.progress-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.progress-label {
    width: 80px;
    font-size: 14px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background-color: #E5E5E7;
    border-radius: 3px;
    overflow: hidden;
    margin: 0 10px;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
}

.progress-value {
    width: 100px;
    text-align: right;
    font-size: 14px;
}

/* 网格布局 */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

/* 标签 */
.badge {
    background-color: rgba(52, 199, 89, 0.1);
    color: #34C759;
    padding: 8px 12px;
    border-radius: 12px;
    text-align: center;
}

.badge h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.badge p {
    font-size: 12px;
    color: #8E8E93;
}

/* 匹配项 */
.match-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    margin-bottom: 12px;
}

/* 匹配容器 */
.match-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zodiac {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.zodiac-1 {
    background-color: rgba(52, 199, 89, 0.1);
    color: #34C759;
}

.zodiac-2 {
    background-color: rgba(90, 200, 250, 0.1);
    color: #5AC8FA;
}

.heart {
    margin: 0 16px;
    color: #FF3B30;
}

.match-info {
    margin-left: auto;
}

.match-percentage {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.match-bar {
    width: 120px;
    height: 4px;
    background-color: #E5E5E7;
    border-radius: 2px;
    overflow: hidden;
}

.match-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s ease;
}

/* 不同情侣组合的进度条颜色 */
.match-fill-aries-leo {
    background-color: #FF9500; /* 白羊与狮子 - 热情橙色 */
}

.match-fill-taurus-virgo {
    background-color: #34C759; /* 金牛与处女 - 稳重绿色 */
}

.match-fill-gemini-libra {
    background-color: #5AC8FA; /* 双子与天秤 - 灵动蓝色 */
}

.match-fill-cancer-scorpio {
    background-color: #9370DB; /* 巨蟹与天蝎 - 神秘紫色 */
}

/* 统计发现 */
.stats-discoveries {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(200, 200, 200, 0.2);
}

.stats-discoveries h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #000000;
}

.stats-discoveries ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stats-discoveries li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    font-size: 14px;
    color: #000000;
    line-height: 1.6;
}

/* 星象图标样式 */
.star-fire::before,
.star-earth::before,
.star-air::before,
.star-water::before {
    content: '●';
    position: absolute;
    left: 0;
    top: 0;
}

.star-fire::before {
    color: #FF3B30;
}

.star-earth::before {
    color: #6AB04C;
}

.star-air::before {
    color: #45B7D1;
}

.star-water::before {
    color: #9370DB;
}

/* 列表项 */
.list-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(200, 200, 200, 0.2);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item .icon {
    margin-right: 12px;
    color: #8E8E93;
}

.list-item .text {
    font-size: 14px;
}

.list-item .value {
    margin-left: auto;
    font-size: 12px;
    color: #8E8E93;
}

/* 图表容器 */
.chart-container {
    height: 300px;
    position: relative;
    margin: 0 auto;
    width: 100%;
}

/* 移动端图表容器适配 */
@media (max-width: 768px) {
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 375px) {
    .chart-container {
        height: 220px;
    }
}

/* 职业滚动容器 - 改为上下滑动 */
.career-scroll-container {
    height: 400px; /* 增加高度，默认可展示5个星座列表组件 */
    overflow-y: auto;
    padding-right: 8px;
    /* 隐藏滚动条但保持功能 */
    -ms-overflow-style: none;  /* IE 和 Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Webkit浏览器特定样式 - 隐藏职业滚动容器的滚动条 */
.career-scroll-container::-webkit-scrollbar {
    display: none;
}

.career-scroll-container::-webkit-scrollbar-track {
    display: none;
}

.career-scroll-container::-webkit-scrollbar-thumb {
    display: none;
}

/* 职业滚动项目 - 改为上图风格 */
.career-scroll-item {
    width: 100%;
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.career-scroll-item h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.career-scroll-item p {
    font-size: 14px;
    color: #1C1C1E;
    line-height: 1.6;
    margin: 0;
}

/* 职业滚动项目悬停效果 */
.career-scroll-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 生活习惯统计网格布局 - 改为单列上下排列 */
.habits-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

.habit-card {
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 280px;
}

/* 习惯卡片头部 */
.habit-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.habit-icon {
    font-size: 20px;
    margin-right: 8px;
}

.habit-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1C1C1E;
    margin: 0;
}

/* 习惯图表容器 - 增大尺寸 */
.habit-chart-container {
    height: 180px;
    width: 100%;
    max-width: 220px;
    position: relative;
    margin-bottom: 16px;
}

/* 习惯发现列表 */
.habit-findings {
    margin-top: 8px;
}

.finding-item {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #1C1C1E;
    margin-bottom: 6px;
}

.finding-icon {
    font-size: 10px;
    margin-right: 6px;
}

.finding-text {
    line-height: 1.4;
}

/* 职业成功指数样式 */
.success-index {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.index-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.index-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zodiac-name {
    font-size: 14px;
    font-weight: 600;
    color: #1C1C1E;
}

.success-score {
    font-size: 12px;
    color: #8E8E93;
}

.index-bar {
    height: 8px;
    background-color: #E5E5E7;
    border-radius: 4px;
    overflow: hidden;
}

.index-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

/* 不同星座的进度条颜色 */
.index-fill-leo {
    background-color: #FF9500; /* 狮子座 - 橙色 */
}

.index-fill-virgo {
    background-color: #34C759; /* 处女座 - 绿色 */
}

.index-fill-libra {
    background-color: #5856D6; /* 天秤座 - 紫色 */
}

/* 响应式调整 */
@media (max-width: 375px) {
    .tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }
    
    .career-scroll-container {
        height: 280px;
    }
    
    /* 生活习惯统计响应式调整 */
    .habits-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

/* 禁用默认点击高亮但保留正常状态过渡 */
* {
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

/* 为按钮添加平滑过渡效果避免闪烁 */
.tab {
    transition: all 0.3s ease;
    will-change: background-color, transform;
}

/* 禁用图表的交互蒙层效果 */
.chart-container {
    pointer-events: none;
}

.chart-container canvas {
    pointer-events: auto;
}